<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<!-- 写js代码的地方 -->
<script>
    // 需求描述： 编写函数计算传入多个参数（参数个数未知）返回相乘的结果
    function getResult() {
        var sum = 1;
        // 遍历参数数组
        for (var i = 0; i < arguments.length; i++) {
            sum *= arguments[i];
        }
        return sum;
    }
    console.log(getResult(2, 3, 4, 5));
</script>

</html>